﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Account/Site.master" AutoEventWireup="true" CodeFile="GioiThieu.aspx.cs" Inherits="Administrator_GioiThieu" %>

<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:SiteMapPath ID="SiteMapPath1" runat="server" Font-Names="Verdana" 
        Font-Size="0.8em" PathSeparator=" : " style="font-size: small">
        <CurrentNodeStyle ForeColor="#333333" />
        <NodeStyle Font-Bold="True" ForeColor="#284E98" />
        <PathSeparatorStyle Font-Bold="True" ForeColor="#507CD1" />
        <RootNodeStyle Font-Bold="True" ForeColor="#507CD1" />
    </asp:SiteMapPath>
    <br />
    <asp:Label ID="Label1" runat="server" 
        style="font-size: x-large; font-weight: 700" Text="Quản lý giới thiệu"></asp:Label>
    <br />
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectServer %>" 
    DeleteCommand="DELETE FROM [GioiThieu] WHERE [ID] = @ID" 
    InsertCommand="INSERT INTO [GioiThieu] ([TieuDe], [NoiDung]) VALUES (@TieuDe, @NoiDung)" 
    SelectCommand="SELECT * FROM [GioiThieu]" 
    UpdateCommand="UPDATE [GioiThieu] SET [TieuDe] = @TieuDe, [NoiDung] = @NoiDung WHERE [ID] = @ID">
    <DeleteParameters>
        <asp:Parameter Name="ID" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="TieuDe" Type="String" />
        <asp:Parameter Name="NoiDung" Type="String" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="TieuDe" Type="String" />
        <asp:Parameter Name="NoiDung" Type="String" />
        <asp:Parameter Name="ID" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
    <asp:FormView ID="FormView1" runat="server" AllowPaging="True" 
        DataSourceID="SqlDataSource1" EnableModelValidation="True" 
        DataKeyNames="ID" Width="100%" CellPadding="4" ForeColor="#333333">
        <EditItemTemplate>
            ID:
            <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
            <br />
            Tiêu đề :
            <asp:TextBox ID="TieuDeTextBox" runat="server" Text='<%# Bind("TieuDe") %>' 
                Width="90%" />
            <br />
            Nội dung :<asp:RequiredFieldValidator ID="RequiredFieldValidator1" 
                runat="server" ControlToValidate="TieuDeTextBox" 
                ErrorMessage="tiêu đề không được rỗng "></asp:RequiredFieldValidator>
&nbsp;<FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath="~/fckeditor/" 
                Height="600px" Value='<%# Bind("NoiDung") %>' Width="100%">
            </FCKeditorV2:FCKeditor>
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <EditRowStyle BackColor="#999999" />
        <EmptyDataTemplate>
            Không có dữ liệu (Click tạo mới)<br />
            <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Tạo mới</asp:LinkButton>
        </EmptyDataTemplate>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <InsertItemTemplate>
            Tiêu đề :
            <asp:TextBox ID="TieuDeTextBox" runat="server" Text='<%# Bind("TieuDe") %>' 
                Width="90%" />
            <br />
            Nội dung :
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="TieuDeTextBox" ErrorMessage="Tiêu đề không được rỗng "></asp:RequiredFieldValidator>
            &nbsp;<FCKeditorV2:FCKeditor ID="FCKeditor2" runat="server" BasePath="~/fckeditor/" 
                Height="600px" Value='<%# Bind("NoiDung") %>' Width="100%">
            </FCKeditorV2:FCKeditor>
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" onclick="InsertButton_Click" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" 
                onclick="InsertCancelButton_Click" />
        </InsertItemTemplate>
        <ItemTemplate>
            ID:
            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
            <br />
            Tiêu đề :
            <asp:Label ID="TieuDeLabel" runat="server" Text='<%# Bind("TieuDe") %>' />
            <br />
            Nội dung :
            <asp:Label ID="NoiDungLabel" runat="server" Text='<%# Bind("NoiDung") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Edit" />
            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Delete" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="New" />
        </ItemTemplate>
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    </asp:FormView>
    <br />
<br />
</asp:Content>

